package com.marktotop.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.marktotop.entity.business.Vaccine;
import com.marktotop.vo.business.VaccineSupplierVO;
import com.marktotop.vo.business.VaccineToDevolutionVO;
import com.marktotop.vo.business.VaccineVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author MarkToTop
 * @since 2021-07-12
 */
public interface VaccineMapper extends BaseMapper<Vaccine> {

    /**
     * 分页展示所有疫苗列表，并进行模糊查询
     *
     * @param page
     * @param vaccineVO
     * @return
     */
    IPage<VaccineVO> getVaccinesByPage(Page<VaccineVO> page, @Param("vaccine") VaccineVO vaccineVO);


    /**
     * 获取某一疫苗完整信息
     *
     * @param id
     * @return
     */
    VaccineVO getOneVacc(Long id);


    /**
     * 更新疫苗库存数
     *
     * @param vaccineVO
     * @return
     */
    boolean updateOverage(@Param("vaccineVO") VaccineVO vaccineVO);


    /**
     * 获取所有疫苗列表，供疫苗下发使用
     *
     * @return
     */
    List<VaccineToDevolutionVO> getAllVaccinesInfo();

}
